package com.cz.video.auth.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.cz.video.auth.service.SysRegisterService;
import com.cz.video.common.core.controller.BaseController;
import com.cz.video.common.core.domain.R;
import com.cz.video.common.core.domain.model.EmailRegisterBody;
import com.cz.video.common.core.domain.model.RegisterBody;
//import com.cz.video.system.service.ISysConfigService;
//import com.cz.video.system.service.SysRegisterService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 注册验证
 *
 * @author cz
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/register")
public class SysRegisterController extends BaseController {

    private final SysRegisterService registerService;



    /**
     * 用户邮箱注册
     */
    @SaIgnore
    @PostMapping("/email")
    public R<Void> registerEmail(@Validated @RequestBody EmailRegisterBody user) {
        registerService.registerEmail(user);
        return R.ok();
    }
}
